package com.example.basic;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

public class ProductActivity extends FragmentActivity {

  public ProductActivity() {
  }

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_product_list);
    if (savedInstanceState == null) {
      int productId = getIntent().getIntExtra(ProductFragment.EXTRA_PRODUCT_ID, 0);
      ProductFragment fragment = ProductFragment.newInstance(productId);
      getSupportFragmentManager().beginTransaction()
      .add(R.id.container, fragment)
      .commit();
    }
  }
}